package com.yy.wga.common.core.dto;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;


/**
 * 分页对象
 *
 * @author <a href="mailto:ludezh@dingtalk.com"> ludezh </a>
 * @version 1.0.0   2018/12/24,20:19
 * @since 1.0.0     2018/12/24,20:19
 */
@Data
public class BasePageReqDTO {

    private static final long serialVersionUID = -1553989654999614328L;

    /**
     * 页码
     */
    @NotNull(message = "页码为空")
    @Range(min = 1, message = "页数最小为1")
    protected Integer pageNum = 1;

    /**
     * 每页条数
     */
    @NotNull(message = "每页条数为空")
    @Range(min = 1, max = 1000, message = "1 <= 每页条数 <= 1000")
    protected Integer pageSize = 20;

    /**
     * 排序字段
     */
    protected String orderBy;

    /**
     * 是否聚合查询
     */
    protected Boolean count = Boolean.FALSE;

    /**
     * 是否升序（true 为升序，false 为降序）
     */
    protected Boolean isAsc = Boolean.TRUE;
}
